sdmetadatadict module¶
-
class
sd.api.sdmetadatadict.SDMetadataDict(APIContext, handle, *args, **kwargs)¶ Bases:
sd.api.sdapiobject.SDAPIObjectDictionary of SDProperties. These properties are to be interprepeted as key-value pairs.
-
deleteProperty(sdProperty: sd.api.sdproperty.SDProperty) → None¶ Delete the specified property Can generate the following error code(s): -
InvalidArgument: sdProperty was not a valid SDProperty. -ItemNotFound: sdProperty was not found in the current SDMetadataDict.- Parameters
sdProperty – The property to remove
-
getClassName() → str¶ Returns the most specific name of the class this APIObject is
-
getProperties() → Optional[sd.api.sdarray.SDArray[sd.api.sdproperty.SDProperty][sd.api.sdproperty.SDProperty]]¶ Get all properties of this SDMetadataDict.
-
getPropertyFromId(sdPropertyId: str) → Optional[sd.api.sdproperty.SDProperty]¶ Get the property that matches the specified identifier. Can generate the following error code(s): -
InvalidArgument: sdPropertyId was not a valid string. -ItemNotFound: no SDProperty with the provided name was found.- Parameters
sdPropertyId – The identifier of the property we want to retrieve
-
getPropertyValue(sdProperty: sd.api.sdproperty.SDProperty) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of the specified property. Can generate the following error code(s): -
InvalidArgument: sdProperty was not a valid SDProperty. -ItemNotFound: sdProperty was not found in the current SDMetadataDict.- Parameters
sdProperty – The property we want to retrieve the value from
-
getPropertyValueFromId(sdPropertyId: str) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of the property that matches the specified identifier. Can generate the following error code(s): -
InvalidArgument: sdPropertyId was not a valid string. -ItemNotFound: no SDProperty with the provided name was found.- Parameters
sdPropertyId – The identifier of the property we want to retrieve
-
release() → None¶ Releases an APIObject
-
setPropertyURLFromResource(sdPropertyId: str, sdResource: SDResource) → None¶ Set an URL pointing to the specified resource as value for the property that matches the specified identifier. If the property doesn’t exists, it is automatically created. Can generate the following error code(s): -
InvalidArgument: sdPropertyId was not a valid string. -InvalidArgument: sdResource was not a valid SDResource. -InvalidValue: sdPropertyId was not a valid XML tag name. -NotSupported: a SDProperty with the given name already exists, and is of type string (changing property type is not supported).- Parameters
sdPropertyId – The identifier of the property for which we want to set the value
sdResource – The value to set
-
setPropertyValue(sdProperty: sd.api.sdproperty.SDProperty, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the value of the specified property. Can generate the following error code(s): -
InvalidArgument: sdProperty was not a valid SDProperty. -InvalidArgument: sdValue was not a valid SDValue. -ItemNotFound: sdProperty was not found in the current SDMetadataDict.- Parameters
sdProperty – The property for which we want to set the value
sdValue – The value to set
-
setPropertyValueFromId(sdPropertyId: str, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the value of the property that matches the specified identifier. If the property doesn’t exists, it is automatically created. Can generate the following error code(s): -
InvalidArgument: sdPropertyId was not a valid string. -InvalidArgument: sdValue was not a valid SDValue. -InvalidValue: sdPropertyId was not a valid XML tag name. -NotSupported: a SDProperty with the given name already exists, and is of type URL (changing property type is not supported).- Parameters
sdPropertyId – The identifier of the property for which we want to set the value
sdValue – The value to set
-